import axios from "axios";

const http = axios.create({
  baseURL: "http://119.29.202.107:9999", //https://show.cool-admin.com/,
  headers: {
    "Content-Type": "application/json;charset=utf-8",
  },
  withCredentials: false,
});

http.interceptors.request.use(
  (config) => {
    // config.headers['Authorization'] = `Basic bWFsbC1hZG1pbjoxMjM0NTY=`;
    // config.headers['Authorization'] = localStorage.getItem("token")
    // console.log("token", localStorage.getItem("token"));

    return config;
  },
  (err: any) => {
    return Promise.reject(err);
  }
);

http.interceptors.response.use(
  (response: any) => {
    return response;
  },
  (err: any) => {
    return Promise.reject(err);
  }
);

export default http;
